package top.lishuoboy.javaweb.a06servlet;

import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * servlet的url-pattern匹配规则  https://blog.csdn.net/lishuoboy/article/details/122631570
 *
 * @author lishuoboy
 * @date 2022/1/21 13:53
 */
@Slf4j
//@WebServlet(name = "UrlPatternServlet1", value = "/*")
public class UrlPatternServlet1 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String str = StrUtil.format("匹配到了UrlPatternServlet1, URI=={}", req.getRequestURI());
        resp.getWriter().write(str);
    }
}
